package com.zking.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016102300747515";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCIwmYTF3PinjdsVpEHLLDLDfG64IFVrpT54l5tBQFXHXgzy+OX+7HA9e6svp4GiVASvrfmpzBD54y3cskK0+pBFzft09QioLT4R3XXGxZ9K1VRvRBaxCOHm/bqwexdqnzscJ9BthUfO/jXALJxiWnfTEUI4x4oBsRxsmt9YEQ/ExZap+DERiXqQVH8jPHvZYWrBGzHxjllFNWzv3woK1dJdRONG6oV6f2wRG7SdK5hK2IyoFIdEqZV/VnH9X5MvayytfX22HbHMfyU5lRGTS8OFghdsDEi0zFc+u85kqWPGqVjrzr1WEgnTYGj47zIzY4XLQ1DFor3fqu4dq5VsOZ1AgMBAAECggEAOpgHweBHf23IUzuXsZo9ORKFYkr0PvCo1ZNeX5lIZLm0mYSew6xMEV+NXifhbu2ACDf8dO9m54EasjKU3nXDJRY8mUIr3pY6UzHS1FG/xes+B+JYUns8ucph9V0W117HXUo3gaDw1cwNJpke2zRDzy9PWKpubjnQCuKl2TbYpqj2Z3ufhpK+uE6LExUBPGxsc0d98pwEsLu5z/Jidix7fPSWZ4G2ARdVAyxsYXY1FFK25zum0fcfmWFKepco5gGHGI1nDDTvIHCSVFGm0Vn7XV6ui74qW67MnHWe+3DZc+hQTwO59Qh0LP2MJSTvcycYxdbF0edYtx72rpMdOrnA4QKBgQDTE/ih4iLvzOr96ZRoXNMCr7SloFpcWBke37vg53Q5pKNQrfnNj6TBSUFeYhr+HAICioSuoGLIgUbBVN/5UJAzXJKnIeY2gH+hnT9OEcgd/zmaFzQ7mmUxTVYglxFOHKiQp/kp63YTzPALGAcYScA4Bm4ZfEHBiUULs/5jb2y7+QKBgQCl3V9OeMuz1I2AeAZBer5EE3/6aNr2TrRzHkMhhAcRKJIFIlMSMJNQa0QEzB44v7KhSpj7AYPYBx92SeoUu8CITAXA+122MZo3HFcHfZrEm5C7YllLe0Ww0l2LKtzVP1r3kttkccBZxleCIxPzZ39fvUFd6YU3SasW77rzIVrFXQKBgEz6opl/XFhyNl1lu18YQ0hehhZFVc8JvheZZu6N2sBO/9Sjrk++jEqFidZ/FvMHieAdXmhFS+Ft7D0D1C8bp4tjvoQ/g7LqyCFLtNOm/oGaHArLXZxDIZaKate14HTJVNx0thUIr2ZnPj/9glDkTLrh9XNL8rs/cbPj7+mZsGEZAoGAE9gti/T14jkfCOzTSshFtV1j5XDgKbH28wL+4yaptcrV1ZlquPVo2qlKxQwq3X1KAPQs43Ml9BW+FOf5AqwH+AaodZNdfevnWIqievnzJ2y5X0IADwDbsLEqkfj53OWsm4xNhXH6ooMRezd5LpkGa0z4YiULVDcTKjZadrZZ5t0CgYA3Ox0JaQHBXAGdA1BJ/aHDG+yuyrF53dz45asY+Pu1nCGP6ESzUOboBBMcQwgFmRQwv10uQbvWlnBrKKt0FcLK/ZOGinO3jjmaZwR9SrKPCe5S1u7xJ+m9q3adqxW5v4y1qIPdOOmTOJbapkA2cEbokgg4GbYQBnFO/3HWlrtgyg==";


    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhCteqLANrNYKwCpmbQqzOxLJNJcjmk4QlmSDZ/Ofr+Dzbl6rxc2NhPbIy/YOJuAsOscdZZEjp2we6DcIENDkFguvexcUKpF49Kivm/t0BDrkUprT5d6XWQtc5tQHdWDnvakOBxbFXAfW3XFokUwjV6jLNFvcE8mCzmXNoHJrcpSg7973pxJqkwhHD5MBcynWBn4sFNdSIsGvqX33OuBb/qOVp+NoLcqvk2ziw7rWVmy7+dRwqCAOaAGbWy2JPhCj+ZLdqL38kcMKlcQkogEdG3gWLcJaa8WfYlJWh7xujJa3unR7fK7B7c/LUEUizrxJvibamb1FH8JxDezaZtrC2wIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/20200331_aliyun/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/finishOrder";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            //84965.87   83965.87
            //29174.81   30174.81
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

